import { PLATFORM_NAME, PLATFORM_ORG } from '../../plugins/constant'
import library from '@/bigbank/router/business/library'
import limit from '@/bank/router/business/limit'
import project28 from '@/bank/router/business/project28'
import index from '@/bank/router/business/index'
import product from '@/bank/router/business/product'

export default {
  path: '/',
  component: () => import(/* webpackChunkName: "bank-res" */ '@/bank/views/Layout.vue'),
  redirect: { name: 'bank_res_index' },
  meta: {
    root: true,
    title: PLATFORM_NAME,
    org: PLATFORM_ORG,
    job: ['business_manager', 'org_corp'],
  },
  children: [
    {
      path: '',
      redirect: 'res_index',
    },
    {
      path: 'res_index',
      component: { render: h => h('router-view') },
      meta: { title: '项目经理操作平台', icon: 'fa fa-fw fa-home', hidden: true },
      children: [
        {
          path: '',
          redirect: 'index',
        },
        {
          path: 'index',
          component: { render: h => h('router-view') },
          meta: {
            title: '首页',
            icon: 'fa fa-home',
            activeSidebar: true,
            job: ['business_manager'],
          },
          children: index,
        },
        {
          path: 'index',
          component: () => import(/* webpackChunkName: "bank" */ '@/bigbank/views/index/Index.vue'),
          meta: { title: '主页', icon: 'fa fa-home', job: ['org_corp'] },
        },
        {
          path: 'library',
          component: { render: h => h('router-view') },
          meta: { title: '项目库', icon: 'fa fa-folder-o' },
          children: library,
        },
        {
          path: 'self',
          component: () =>
            import(/* webpackChunkName: "bank-self" */ '@/bigbank/views/self/Index.vue'),
          meta: { title: '自有业务', icon: 'fa fa-paperclip' },
        },
        {
          path: 'limit',
          component: { render: h => h('router-view') },
          meta: { title: '限率业务', icon: 'fa fa-calendar-minus-o', activeSidebar: true },
          children: limit,
        },
        {
          path: 'mission',
          component: { render: h => h('router-view') },
          meta: { title: '28业务', icon: 'fa fa-calendar-check-o' },
          children: project28,
        },
        {
          path: 'product',
          component: { render: h => h('router-view') },
          meta: { title: '产品管理', icon: 'fa fa-fw fa-file-archive-o' },
          children: product,
        },
        {
          path: 'count',
          component: () =>
            import(/* webpackChunkName: "credit-index" */ '@/bank/views/business/count/Index.vue'),
          meta: { title: '数据统计', icon: 'fa fa-bar-chart-o' },
        },
      ],
    },
  ],
}
